<?php
namespace testnamespace;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of testclass
 *
 * @author menla
 */
class testclass {
    //put your code here
    function __construct() {
        echo __METHOD__,"\n";
    }
}
function funname(){
    echo __FUNCTION__."\n";
}

const constname="const";

$a='\testnamespace\testclass';
$obj=new $a;
$b='\testnamespace\funname';
$b();
echo constant('\testnamespace\constname'),"\n";

echo '"',__NAMESPACE__,'"',"<br>";

function get($className){
    $a=__NAMESPACE__.'\\'.$className;
    return new $a;
}

$x=get('testclass');
//echo $x. "<br>";s

class Exception extends \Exception{}

$a=new Exception("hi!");
$b=new \Exception("hello!");

echo '<br>';

var_dump($a);
echo '<br>';
var_dump($b);
echo '<br>';
$c=new \ArrayObject;
var_dump($c);
echo '<br>';
$d=new ArrayObject;
var_dump($d);
